<?php

class HomepageImageTable extends Doctrine_Table
{
  public function getBackendListQuery(Doctrine_Query $query)
  {
    $rootAlias = $query->getRootAlias();

    return $query->leftJoin("$rootAlias.contestant c");
  }
  
  public function getHomepageList()
  {
    return $this->createQuery('h')
      ->leftJoin('h.contestant c')
      ->leftJoin('c.application a')
      ->leftJoin('c.area r')
      ->orderBy('order')
      ->limit(10)
      ->execute();
  }
}
